import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Random;



/*@Sangeeta
 *@Uses: Used to select 100 bugids randomly.
 *
 **/
public class select_100_bugs 
{

	 public Connection conn =  null;
	 public String dbname="jboss";
	 public String userid="root";
	 public String passwd = "123";
	 public ArrayList<String> bugids =  null;
	 public ArrayList<String> nfids =  null;
	
public void select(Connection conn)
 {
		 bugids =  new ArrayList<String>();
		 nfids  =  new ArrayList<String>();
		 
		 Statement stmt =  null;
		 String bug_q= "select distinct bugid from tdfp_match_score";
		 
		 try 
		 {
			
			 stmt =  conn.createStatement();
			 stmt.execute(bug_q);
			 ResultSet rs = stmt.getResultSet();
			 while(rs.next())
			 {
				 String bugid =  rs.getString("bugid");
				 bugids.add(bugid);
			 }
			
			 ArrayList<String> selected_bugs =  new ArrayList<String>();      
			 for(int i=0;i<100;i++)
			 {
				 Random r =  new Random();
				 
			 }
			 
			 if(rs!=null)
			 {rs.close();}
			 
			 if(stmt!=null)
			 {stmt.close();}
			 
		 }catch(SQLException e)
		 {e.printStackTrace();}
 }
	 
public static void main()
{

		select_100_bugs obj =  new select_100_bugs();
		db_conn db=  new db_conn();
		obj.conn = db.connect(obj.dbname, obj.userid, obj.passwd);
		obj.select(obj.conn);
		db.close(obj.conn);
     		
 }

}//class
